<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <title>example.h</title>
</head>
<body>
<pre><tt>
<font color="#000080">#ifndef</font> __EXAMPLE__<br><font
 color="#000080">#define</font> __EXAMPLE__<br><br><br><font
 color="#000080">#include</font> <font color="#000000">"coid/coidsvc/coidsvc.h"<br><br><br><span
 style="color: rgb(255, 0, 0);">/* declaration of used structs with streaming operators implemented was excluded for clarity,</span><br
 style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">   look <a
 href="example.h.html">here</a> for the full version */</span><br><br><br></font><font
 color="#ff0000"></font><font color="#ff0000">///Example decorated class</font>
<font color="#0000ff">class</font> example<br><font color="#000080">{</font>
    cmd_interface * _cmdin;
    FOO_STRUCT      _fs;

<font color="#0000ff">public</font>:<br>    <font color="#000000">example(</font>) : <font
 color="#000000">_cmdin(</font>NULL)  <font color="#000080">{</font><font
 color="#000080">}</font>


    <font color="#ff0000">//some optional special functions, recognized by coidgen tool</font>
    <font
 color="#8800a3">net_fnc_s</font> <font color="#0000ff">opcd</font> <font
 color="#000000">accept_startup_params(</font> cmd_interface &amp; cmd ) <font
 color="#000080">{</font>_cmdin = &amp;cmd; <font color="#0000ff">return</font> <font
 color="#00d000">0</font>;<font color="#000080">}</font>
    <font
 color="#8800a3">net_fnc_s</font> <font color="#0000ff">opcd</font> <font
 color="#000000">accept_connect(</font> <font color="#0000ff">const</font> <font
 color="#0000ff">charstr</font> &amp; name, <font color="#8800a3">net_nolog</font> <font
 color="#0000ff">const</font> password &amp; pwd ) <font color="#000080">{</font><font
 color="#0000ff">return</font> <font color="#00d000">0</font>;<font
 color="#000080">}</font>


    <font color="#ff0000">//user functions</font>
    <font
 color="#8800a3">net_fnc</font> <font color="#8800a3">net_nolog</font> <font
 color="#0000ff">opcd</font> <font color="#000000">read1(</font> <font
 color="#8800a3">net_out</font>   FOO_STRUCT  &amp; list )    <font
 color="#000080">{</font>list =  _fs; <font color="#0000ff">return</font> <font
 color="#00d000">0</font>;<font color="#000080">}</font>
    <font
 color="#8800a3">net_fnc</font> <font color="#8800a3">net_nolog</font> <font
 color="#0000ff">opcd</font> <font color="#000000">read2(</font> <font
 color="#8800a3">net_fetch</font> FOO_STRUCT *&amp; list )    <font
 color="#000080">{</font>list = &amp;_fs; <font color="#0000ff">return</font> <font
 color="#00d000">0</font>;<font color="#000080">}</font>

    <font
 color="#8800a3">net_fnc</font> <font color="#8800a3">net_nolog</font> <font
 color="#0000ff">opcd</font> <font color="#000000">send(</font> <font
 color="#8800a3">net_inout</font> <font color="#0000ff">int</font> &amp; ref, <font
 color="#0000ff">const</font> <font color="#0000ff">charstr</font> &amp; command, <font
 color="#8800a3">net_out</font> binstreambuf &amp; reply ) <font
 color="#0000ff">const</font>
    <font color="#000080">{</font>
        <font
 color="#0000ff">return</font> <font color="#00d000">0</font>;<br>    <font
 color="#000080">}</font>

    <font color="#8800a3">net_fnc</font> <font
 color="#0000ff">opcd</font> <font color="#000000">remap_fnc(</font> <font
 color="#8800a3">net_out</font> <font color="#8800a3">net_remap</font>(REMAP_EXAMPLE_clientside &amp;) REMAP_EXAMPLE &amp; arg ) <font
 color="#000080">{</font>
        arg.err_text = <font color="#000000">"Foo"</font>;<br>        <font
 color="#0000ff">return</font> <font color="#00d000">0</font>;<br>    <font
 color="#000080">}</font>

    <font color="#ff0000">//method available only in direct (client&amp;server in the same process) mode</font>
    <font
 color="#8800a3">net_fnc_d</font> <font color="#0000ff">opcd</font> <font
 color="#000000">get_ptr(</font> FOO_STRUCT ** f )   <font
 color="#000080">{</font>*f = &amp;_fs; <font color="#0000ff">return</font> <font
 color="#00d000">0</font>;<font color="#000080">}</font>
<font color="#000080">}</font>;<br><br><br><font color="#000080">#endif</font> <font
 color="#ff0000">// !__EXAMPLE__</font>
</tt>
</pre>
</body>
</html>
